/*
 * Copyright (c) 2020-2099 the original author or authors. All rights reserve.
 */
package org.tianyun.cloud.security.token.store;

import org.tianyun.cloud.security.token.common.AccessToken;

import java.security.Principal;

/**
 * Token存储容器
 *
 * @auther ebert_chan
 */
public interface TokenStore {

    /**
     * 从容器中获取AccessToken
     *
     * @param principal
     * @return
     * @auther ebert_chan
     */
    AccessToken getAccessToken(Principal principal);

    /**
     * 将AccessToken保存到容器中
     *
     * @param principal
     * @param accessToken
     * @auther ebert_chan
     */
    void storeAccessToken(Principal principal, AccessToken accessToken);

    /**
     * 从容器中移除AccessToken
     *
     * @param principal
     * @auther ebert_chan
     */
    void removeAccessToken(Principal principal);

}
